import http from '@/utils/http';



/**
 * 删除区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const removeCode = (params: any) => {
  return http.delete('bus/code/remove', {params});
}

/**
 * 获取系统用户列表
 * @param params
 * @returns {*|Promise<any>}
 */
export const getCodeList = (params?: any) => {
  return http.get('bus/code/list', {params});
}

/**
 * 保存修改区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const updateCode = (params: any) => {
  return http.put('bus/code/edit', params);
}

/**
 * 保存新增区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const addCode = (params: any) => {
  return http.post('bus/code/add', params);
}

/**
 * 通过id获取区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const getById = (params: any) => {
  return http.get('bus/code/' + params.id);
}

/**
 * 验证区域名称是否唯一
 * @param params
 * @returns {*|Promise<any>}
 */
export const checkCodeUnique = (params: any) => {
  params.loading = false;
  return http.post('bus/code/checkCodeUnique', params);
}

/**
 * 通过id获取区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const categoryList = (params?: any) => {
  return http.get('bus/code/categoryList');
}

/**
 * 通过id获取区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const categoryData = (params?: any) => {
  return http.get('bus/code/categoryData',{params});
}

